package no.sachmuld.methodcombination.impl.validate;

/**
 *
 */
public class ObsoleteBehaviourMethod extends MethodCombinationValidationError {
    private Class behaviourClass;
    private String methodName;
    private Class<?>[] parameterTypes;

    public ObsoleteBehaviourMethod(Class targetClass, Class behaviourClass, String methodName, Class<?>[] parameterTypes) {
        super(targetClass);
        this.behaviourClass = behaviourClass;
        this.methodName = methodName;
        this.parameterTypes = parameterTypes;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Obsolete method ");
        sb.append(format(methodName, parameterTypes));
        sb.append(" in behaviour class ");
        sb.append(behaviourClass.getName());
        return sb.toString();
    }
}
